﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace Dashboard.Models
{
    public class DiskSpace
    {
        public static string[][] AllDisks = new string[100][];

        public static string[][] GetTotalHDDSize()
        {
            int j = 0;
            for (int i = 0; i < 100; i++)
            {
                AllDisks[i] = new string[3];
            }

            foreach (DriveInfo drive in DriveInfo.GetDrives())
            {
                if (drive.IsReady == true && drive.Name != null)
                {
                    AllDisks[j] = new string[] { drive.Name + "\\", Convert.ToString(drive.TotalFreeSpace / (1024 * 1024 * 1024)), Convert.ToString((drive.TotalSize - drive.TotalFreeSpace) / (1024 * 1024 * 1024)) };
                }
                j++;
            }

            return AllDisks;
        }
    }
}